using System;
using System.Collections.Generic;
using Soveryn.Commerce.API;
using Soveryn.Commerce.BaseClasses;
using Soveryn.Commerce.Shared;

namespace Soveryn.Commerce.Pages
{
    public partial class Unsubscribe : PageBaseClass
    {
        protected new void Page_PreInit(object sender, EventArgs e)
        {
            Website = WebsiteData.WebsiteDetail(); //we call this again in the baseclass because event handling is weird
            PageID = Website.CheckoutTemplatePageID.Value;
            base.Page_PreInit(sender, e);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            testLabel.Text = WebsiteAPIKey;
        }

        protected void UnsubscribeButton_Click(Object sender, System.EventArgs e)
        {


            Dictionary<string, object> EmployeeExternalSessionValidArgs = new Dictionary<string, object>();
            EmployeeExternalSessionValidArgs.Add("WebsiteAPIKey", PageBaseClass.WebsiteAPIKey);
            EmployeeExternalSessionValidArgs.Add("EmailAddress", EmailAddessTextBox.Text);
            APIEnvelope env = Soveryn.Commerce.Shared.API.Call(PageBaseClass.EmployeeAPIURL, "EmarketingEmailDoNotSendAdd", EmployeeExternalSessionValidArgs, false, false);
        }
    }
}